package com.yuju.upload.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuju.common.core.dao.IBaseDao;
import com.yuju.common.core.service.AbstractBaseService;
import com.yuju.upload.dao.IMultimediaDao;
import com.yuju.upload.dao.entity.Multimedia;
import com.yuju.upload.model.MultimediaModel;
import com.yuju.upload.service.IMultimediaService;

/**
 * 
 * 类名：MultimediaServiceImpl  <br />
 *
 * 功能：多媒体资源Service业务接口实现
 *
 * @author : xuehj <br />
 * @Date : 2018年1月12日 下午4:24:32  <br />
 * @version : 1.1 <br />
 */
@Service
public class MultimediaServiceImpl extends AbstractBaseService<MultimediaModel, Multimedia, String> implements IMultimediaService {
	@Autowired
	private IMultimediaDao multimediaDao;
	
	@Override
	public IBaseDao<MultimediaModel, Multimedia, String> getDao() {
		// TODO Auto-generated method stub
		return multimediaDao;
	}

	@Override
	public int delByPath(String path) {
		MultimediaModel paramModel = new MultimediaModel();
		paramModel.setResourceUrl(path);
		MultimediaModel model = find(paramModel);
		return del(model.getId());
	}

}
